Skip to content

Move the wrapper cursors to the cursor module - #823

Merged
frankmcsherry merged 4 commits into
master-nextfrom
cursor-wrappers
Aug 7, 2026
Merged

Move the wrapper cursors to the cursor module#823
frankmcsherry merged 4 commits into
master-nextfrom
cursor-wrappers

Conversation

@frankmcsherry

@frankmcsherry frankmcsherry commented Aug 7, 2026

Copy link
Copy Markdown
Member

Migrate the cursor-specific aspects of traces wrappers (enter and frontier) from their definitions to a cursor/wrappers module, as part of relocating as much cursor-specific content to be literally cursor adjacent, rather than throughout the codebase.

frankmcsherry and others added 4 commits August 7, 2026 17:27
The `enter` wrapper had two halves. One presents a wrapped trace and batch, rewriting descriptions and compaction frontiers through `Refines`; it names no keys and no values. The other navigates the wrapped batch with a cursor.

This moves the second half to `trace/cursor/wrappers/enter.rs`, leaving `trace/wrappers/enter.rs` free of any cursor mention. A reader who declines cursors keeps the wrapper and supplies its own module beside this one.

The cursor reaches the wrapped batch through a new `inner()` accessor. It sits in its own unbounded impl block because the `Cursor` impl does not know that the wrapped storage is a `BatchReader`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
As with `enter`, the wrapper splits into a half that presents a wrapped trace and batch and a half that navigates it. The second half moves to `trace/cursor/wrappers/frontier.rs`.

The time semantics stay with the batch, as `advance_time`, which advances a time by `since` and reports whether `until` suppresses it. Any reader of the wrapped batch applies that rule, whether or not it reads through a cursor.

The cursor no longer keeps its own copies of the two frontiers, so it holds nothing but the cursor it forwards to. Its bound strengthens to `Storage: BatchReader<Time = C::Time>`, which is what lets it hand its owned time to the batch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`advance_time` borrowed `since` from the batch on every time it advanced. The borrow is a slice construction and the comparisons are unchanged, but it put a call boundary inside the per-update closure, where the prior code hoisted both frontiers above it.

The batch now lends its frontiers as an `Advance`, which a reader acquires once and applies to each time. The semantics still belong to the batch, so a reader that does not use cursors still gets them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This reverts commit 2960609.

The borrowed frontiers are `Antichain<Time>`, never a time container, so borrowing one per time costs a slice construction from an inlined method rather than anything a container layout could make expensive. The `Advance` type was not worth its own name.

`advance_time` keeps an `#[inline]`, matching the forwarders around it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@frankmcsherry
frankmcsherry merged commit 31723ae into master-next Aug 7, 2026
6 checks passed
@frankmcsherry
frankmcsherry deleted the cursor-wrappers branch August 7, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant